<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>展华科技产品集团用户管理系统</title>
  <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  <!-- Bootstrap 3.3.2 -->
  <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <!-- FontAwesome 4.3.0 -->
  <link href="plugins/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  <!-- Theme style -->
  <link href="css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link href="css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
  <!-- Date Picker -->
  <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
  <!-- Daterange picker -->
  <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
  <!-- bootstrap wysihtml5 - text editor -->
  <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
  <!-- bootstrap checkbox -->
  <link href="plugins/bootstrap-checkbox/css/bootstrap-checkbox.css" rel="stylesheet" type="text/css" />
  <link href="css/app.css" rel="stylesheet" />
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="http://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="http://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
<script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
<script src="js/diandongche.js" type="text/javascript"></script>
<script src="laydate/laydate.js" type="text/javascript"></script>
</head>
<body class="skin-blue" >
<div class="wrapper">
  <header class="main-header">
    <!-- Logo -->
    <a href="/" class="logo">展华集团用户管理系统</a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">切换侧边栏</span>
      </a>
      
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
  <!-- sidebar: style can be found in sidebar.less -->
  <section class="sidebar">
    <!-- sidebar menu: : style can be found in sidebar.less -->
    <ul class="sidebar-menu" id="sidebar-menu">
      
    </ul>
    <script>
        ddche.leftNav();
    </script>
  </section>
  <!-- /.sidebar -->
</aside>
    <!--********************************************************************************************** -->
<aside class="right-side">
    <section class="content">
<div class="box box-success">
    <div class="box-header">
      <h3 class="box-title">定时上报</h3>
    </div>
    <div class="box-body">
        <form class="form-inline" data-parsley-validate>
         
          <div class="form-group">
            <label>分组名</label>
            <select class="form-control groupList">
            </select>
          </div>
          <div class="form-group">
            <label>设备型号</label>
            <input type="text" class="form-control" name="deviceType" value="CBB-100" readonly>
          </div>
         
          <button type="submit" class="btn btn-primary">查询车辆</button>
        </form>
    </div>
  </div>
    <div class="box">
      <div class="box-header">
            <div class="pull-right">
            <a class="btn btn-primary j-student-download-example" href="javascript:" style="display:none;" id="sysSetTime">定时定位设置</a>
          </div>
      </div>
        <table class="table table-bordered">
              <thead>
                <tr>
                    <th><label><input type="checkbox" rel="all">全选</label></th>
                    <th>设备型号</th>
                    <th>车牌号</th>
                    <th>IMEI</th>
                    <th>分组</th>
                    <th>操作</th>
                </tr>
              </thead>
                <tbody id="cont">
                 
                </tbody>
            </table>
            <table style="display:none;">
                <tbody id="temp" rel="/api/device/list" type="get">
                 <tr rel="{deviceId}">
                      <td><input type="checkbox" value="{deviceId}" /></td>
                      <td>{deviceType}</td>
                      <td>{vehicleNumber}</td>
                      <td><a href="car-detail.html?carDeviceId={deviceId}">{imei}</a></td>
                      <td>{deviceGroupName}</td>
                      <td><a class="btn btn-primary sys-set" href="javascript:" data="{deviceId}" >设置</a></td>
                  </tr>
                </tbody>
            </table>
    </div>

  </div><!-- /.box (chat box) -->
    </section>
  </aside>
    <!--********************************************************************************************** -->

</div><!-- /.content -->
</div><!-- /.content-wrapper -->
<footer class="main-footer">
  <div class="pull-right hidden-xs">
    <b>电话：0755-82049709&nbsp;&nbsp;邮箱：zhanhuakj@foxmail.com&nbsp;&nbsp;深圳市车公庙天安数码时代大厦A座2207-2208号</b>
  </div>
  <strong>Copyright &copy; 2014-2025 <a href="#">深圳市展华科技有限公司</a>.</strong>
</footer>
</div><!-- ./wrapper -->


<div class="modal fade modal_set" tabindex="-1" role="dialog" data-toggle="modal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
          <h4 class="modal-title j-waiting-msg">定时定位设置</h4>
        </div>
            <div class="modal-body setG2" style="overflow:hidden;">
                  <form class="form-block" data-parsley-validate>
                    <div class="form-group col-lg-6">
                      <label>时间1：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>
                     <div class="form-group  col-lg-6">
                      <label>时间2：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>
                     <div class="form-group col-lg-6">
                      <label>时间3：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>
                     <div class="form-group col-lg-6">
                      <label>时间4：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>
                    
                     <div class="form-group col-lg-6">
                      <label>时间5：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>

                     <div class="form-group col-lg-6">
                      <label>时间5：</label>
                      <input type="number" class="form-control hour" >时
                      <input type="number" class="form-control minute" >分
                    </div>
                   

                     <div class="form-group col-lg-12">
                      <label>持续工作至：</label>
                      <input type="text" class="form-control" name="name" style="width:300px;" onclick="laydate({format:'YYYY-MM-DD hh:mm'})" >
                    </div>
                   
                  </form>
            </div>
            <div class="modal-footer">
                <button type="button" id="timeSubmit" class="btn btn-primary modal-confirm" data-dismiss="modal">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>



<div class="modal fade modal_alert" tabindex="-1" role="dialog" data-toggle="modal" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">提示</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary modal-confirm" data-dismiss="modal">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!-- jQuery 2.1.3 -->
<!-- parsley.js -->
<script>
window.ParsleyConfig = {
  errorsWrapper: '<span class="parsley-error"></span>',
  errorTemplate: '<span></span>'
};


     //设置定时上报
     $("#sysSetTime").click(function(){
        var list="";
        if($("#cont input:checked").length<1){
            $(".modal_alert").modal().find(".modal-body").html("请选择设备");
        }else{
          for(var i=0;i<$("#cont input:checked").length;i++){
            list+=","+$("#cont input:checked").eq(i).val();
          }
          $(".modal_set").attr("rel",list.slice(1)).modal();
        }
        
     });

     //单个设置
     $(document).on("click",".sys-set",function(){
        $(".modal_set").attr("rel",$(this).attr("data")).modal().find("input").val("");
     });

     //静默时间时间输入
    $(document).on("change",".hour",function(){
      var num=parseInt($(this).val());
        if(num.toString()!="NaN"){
            if(num<0){
                 $(this).val("00");
            }
            if(num>23){
                 $(this).val(23);
            }
            if($(this).val().length>2){
              $(this).val(num);
            }
            if(num<10){
              $(this).val("0"+num);
            }
        }else{
          $(this).val("00");
        }
    });
    $(document).on("change",".minute",function(){
      var num=parseInt($(this).val());
        if(num.toString()!="NaN"){
            if(num<0){
                 $(this).val("00");
            }
            if(num>59){
                 $(this).val(59);
            }
            if($(this).val().length>2){
              $(this).val(num);
            }
            if(num<10){
              $(this).val("0"+num);
            }
        }else{
          $(this).val("00");
        }
    });

    //提交
    $("#timeSubmit").click(function(){
      var that=$(this).closest(".modal");
      var deviceId=that.attr("rel");
      var timeList="";
      for(var i=0;i<that.find(".form-group").length;i++){
        if(that.find(".form-group").eq(i).find("input:eq(0)").val()){
            timeList+=","+that.find(".form-group").eq(i).find("input:eq(0)").val()+":"+(that.find(".form-group").eq(i).find("input:eq(1)").val()||"00");
        }
      }
      $.ajax({
        type:"post",
        url:"/api/device/config/g2ReportTime/"+deviceId,
        data:{
          g2ReportTime:timeList.slice(1)
        }
      }).done(function(data){
        if(data.code==0){
            $(".modal_alert").modal().find(".modal-body").html("保存成功！");
        }else{
            $(".modal_alert").modal().find(".modal-body").html("保存失败,请重试！");
        }
      });
    });
</script>
<script src="plugins/bower_components/parsleyjs/dist/parsley.js"></script>
<script src="plugins/bower_components/parsleyjs/src/i18n/zh_cn.js"></script>
<!-- jQuery UI 1.11.2 -->
<script src="plugins/jQueryUI/jquery-ui.min.js" type="text/javascript"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.2 JS -->
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Bootstrap-Checkbox -->
<script src="plugins/bootstrap-checkbox/js/bootstrap-checkbox.js" type="text/javascript"></script>
<!-- Sparkline -->
<script src="plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
<!-- daterangepicker -->
<script src="plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<!-- datepicker -->
<script src="plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
<!-- Slimscroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<!-- FastClick -->
<script src='plugins/fastclick/fastclick.min.js'></script>
<!-- Momentjs-->
<script src='plugins/moment/moment.js'></script>
<!-- Jquery serializeJson-->
<script src="plugins/serialize-object/jquery.serialize-object.min.js"></script>
<!-- AdminLTE App -->
<script src="js/app.min.js" type="text/javascript"></script>
</body>
</html>